package bungaeting.net.client.android.request;

import java.util.HashMap;
import java.util.Map;

public class Request {
	private String serviceId;
	private String requestId;
	private Map<String, Object> params;
	
	public static Request createRequest(String serviceId, String requestId, String paramKey, String paramValue){
		Map<String, Object> map = new HashMap<String, Object>();
		map.put(paramKey, paramValue);
		return new Request(serviceId, requestId, map);
	}
	public static Request createRequest(String serviceId, String requestId, Map<String, Object> params){
		return new Request(serviceId, requestId, params);
	}

	public Request(String serviceId, String requestId,
			Map<String, Object> params) {
		super();
		this.serviceId = serviceId;
		this.requestId = requestId;
		this.params = params;
	}
	
	public String getServiceId() {
		return serviceId;
	}
	public void setServiceId(String serviceId) {
		this.serviceId = serviceId;
	}
	public String getRequestId() {
		return requestId;
	}
	public void setRequestId(String requestId) {
		this.requestId = requestId;
	}
	public Map<String, Object> getParams() {
		return params;
	}
	public void setParams(Map<String, Object> params) {
		this.params = params;
	}

	public String toString(){
		return serviceId + " " + requestId + " " + params;
	}
	public Map<String, Object> toMap(){
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("serviceId", serviceId);
		map.put("requestId", requestId);
		map.put("params", params);
		return map;
	}
}
